<script setup lang="ts">
const emitItem = defineEmits(['decMoney'])

const props = defineProps({
    money: {
        type: Number
    }
})

const dec = (money) => {
    emitItem('decMoney', money)
}
</script>
<template>
    <div class="son">
        <button class="defaultButton" @click="dec(30)">- 减少金额</button>
        <div class="info">我是子组件,金额： {{ money }}</div>
    </div>
</template>

<style scoped>
.son{
    width: 500px;
    background: #ede3e3;
    border-radius: 12px;
    padding:20px 20px 80px 20px;
    margin-top: 10px;
    border: 1px solid #c0c0c0;
    box-shadow: 3px 3px 10px #7c7b7b;
}
.info{
    padding: 50px 0 0;
    text-align: center;
}
</style>